﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Castle.Core.Internal;
using Coldairarrow.Util;
using Coldairarrow.Entity.Base_Manage;

namespace Coldairarrow.Entity.Interface
{
    /// <summary>
    /// one_Link操作日志
    /// </summary>
    /// 

    public class OL_OperationLog
    {
        /// <summary>
        /// 日志列表
        /// </summary>
        public List<Logs> logs { get; set; }


        public class Logs
        {
            /// <summary>
            /// 操作人信息
            /// </summary>
            public OpeartorInfo opeartorInfo { get; set; }
            public class OpeartorInfo
            {
                /// <summary>
                /// 操作者ID
                /// </summary>
                public string accountId { get; set; }
                /// <summary>
                /// 名称
                /// </summary>
                public string fullname { get; set; }
                /// <summary>
                /// 头像地址
                /// </summary>
                public string avatar { get; set; }
                /// <summary>
                /// 入口
                /// </summary>
                public string isPortal { get; set; }
                /// <summary>
                /// 状态
                /// </summary>
                public string status { get; set; }
            }

            /// <summary>
            /// 操作内容
            /// </summary>
            public OperatContent operatContent { get; set; }
            public class OperatContent
            {
                /// <summary>
                /// 工作表ID
                /// </summary>
                public string worksheetId { get; set; }
                /// <summary>
                /// 操作对象ID
                /// </summary>
                public string objectId { get; set; }
                /// <summary>
                /// 操作唯一标识
                /// </summary>
                public string uniqueId { get; set; }
                /// <summary>
                /// 日志对象类型
                /// </summary>
                public string objectType_;
                public string objectType
                {
                    get { return objectType_; }
                    set
                    {
                        if (value == "1") objectType_ = "工作表";
                        else if (value == "2") objectType_ = "行记录";
                        else if (value == "3") objectType_ = "视图";
                        else if (value == "4") objectType_ = "按钮";
                        else if (value == "5") objectType_ = "业务规则";
                        else if (value == "99") objectType_ = "其他";
                        else objectType_ = value;
                    }
                }
                /// <summary>
                /// 类型
                /// </summary>
                public string type { get; set; }
                /// <summary>
                /// 日志操作类型
                /// </summary>
                public string requestType_;
                public string requestType
                {
                    get { return requestType_; }
                    set
                    {
                        if (value == "1") requestType_ = "手动操作";
                        else if (value == "2") requestType_ = "工作流触发";
                        else if (value == "3") requestType_ = "按钮触发";
                        else if (value == "7") requestType_ = "工作流触发";
                        else if (value == "8") requestType_ = "关联表触发";
                        else requestType_ = value;
                    }
                }

                /// <summary>
                /// 操作创建的时间戳
                /// </summary>
                public string createTime { get; set; }
                /// <summary>
                /// 日志内容
                /// </summary>
                public List<LogData> logData { get; set; }
            }
            public class LogData
            {
                /// <summary>
                /// 操作项ID
                /// </summary>
                public string id { get; set; }
                /// <summary>
                /// 操作项名称
                /// </summary>
                public string name { get; set; }
                /// <summary>
                /// 更新类型
                /// </summary>
                public string editType_;
                public string editType
                {
                    get { return editType_; }
                    set
                    {
                        if (value == "1") editType_ = "添加";
                        else if (value == "2") editType_ = "取消";
                        else if (value == "0") editType_ = "更新";
                        else editType_ = value;
                    }
                }
                /// <summary>
                /// 类型
                /// </summary>
                public string type_;
                public string type
                {
                    get { return type_; }
                    set
                    {
                        if (value == "29") type_ = "关联记录";
                        else if (value == "2") type_ = "文本";
                        else if (value == "6") type_ = "数值";
                        else if (value == "11") type_ = "单选";
                        else if (value == "16") type_ = "时间";
                        else if (value == "26") type_ = "成员";
                        else if (value == "14") type_ = "附件";
                        else if (value == "52") type_ = "页标签";
                        else if (value == "30") type_ = "他表字段";
                        else if (value == "31") type_ = "公式";
                        else if (value == "37") type_ = "汇总";
                        else if (value == "22") type_ = "分段";
                        else if (value == "38") type_ = "公式（日期）";
                        else type_ = value;
                    }
                }
                /// <summary>
                /// 操作前的值
                /// </summary>
                public string oldValue { get; set; }
                /// <summary>
                /// 操作前的描述
                /// </summary>
                public string oldText { get; set; }
                /// <summary>
                /// 操作后的值
                /// </summary>
                public string newValue { get; set; }
                /// <summary>
                /// 操作后的描述
                /// </summary>
                public string newText { get; set; }

            }



            /// <summary>
            /// 扩展参数
            /// </summary>
            public List<string> extendParams { get; set; }

        }

        /// <summary>
        /// 最后一次更新时间
        /// </summary>
        public string lastMark { get; set; }

        /// <summary>
        ///标志
        /// </summary>
        public bool flag { get; set; }

    }






}
